{% extends "layout/base.html" %}

{% block title %}Dashboard{% endblock %}
{% block head %}
    {{ super() }}
    <style type="text/css">
        .sub-header {
            line-height: 1.4em;
        }

        a {
            font-weight: bold;
        }

        .panel {
            line-height: 1.5em;
        }

        .group-name {
            text-transform: lowercase;
        }
    </style>
{% endblock %}
{% block panel %}

{% endblock %}
{% block content %}
    <div class="panel highlight">
        <h2>Collection overview</h2>
        <div class="sub-header">
            Open Data Cube {{ datacube_version }}
        </div>
    </div>
    <div class="panel">
        Products available on this Open Data Cube instance
        {# TODO: Links to Website, CMI Metadata, DEA, ODC, help? #}
    </div>
    {% from "layout/macros.html" import chart_timeline %}
    <div class="panel odd">
        {% for group_name, product_summaries in grouped_products %}
            <h2 class="group-name">{{ group_name }}</h2>
            <div class="panel odd">
                {% for product, summary in product_summaries %}
                    <h3>
                        <a href="{{ url_for('overview_page', product_name=product.name) }}">
                            {{ product.name }}
                        </a>
                    </h3>
                    <p>
                        {{ product.definition.description }}
                        <strong>({{ summary.dataset_count }} total datasets)</strong>
                    </p>
{#                    {{ chart_timeline(summary.dataset_counts, product) }}#}
                {% endfor %}
            </div>
        {% endfor %}
    </div>
{% endblock %}
